home *** CD-ROM | disk | FTP | other *** search
/ Dimension 64 13 / Dimension_64_Nr.13_19xx_-_de_Side_A.d64 / reversi ii (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  11KB  |  357 lines

  1. 10000 rem ############################
  2. 10010 rem ############################
  3. 10020 rem #####                  #####
  4. 10030 rem #####  r e v e r s i   #####
  5. 10040 rem #####                  #####
  6. 10100 rem ############################
  7. 10110 rem ############################
  8. 11010 poke53280,0:poke53281,0:print"[158][147]"
  9. 11020 print " [169]  [223][146]     [146]  [146]   [146]     [146]  [146]     [146]    [169]  [223][146]"
  10. 11030 print "  [146]   [146]  [161][146][161]   [146]   [146]  [146]     [146]     [146]     [146]   [146]"
  11. 11040 print "  [146]   [146]  [161][146][161]      [146]    [146]   [146]     [146]     [146]   [146]"
  12. 11050 print "  [146]   [146]  [161][146][161]   [146]   [146]  [146]     [146]     [146]     [146]   [146]"
  13. 11060 print " [223]  [146][169]  [161][146][161]   [146]   [146]     [146]     [146]     [146] [223]  [146][169]"
  14. 11070 print ""
  15. 11080 print ""
  16. 11090 print " kennen sie die spielregeln (j/n) ?"
  17. 11100 get a$
  18. 11110 if a$="j" then 11510
  19. 11120 if a$<>"n" then 11100
  20. 11200 print "[147]         s p i e l r e g e l            [146]"
  21. 11210 print " reversi ist ein altes chinesisches "
  22. 11220 print " brettspiel. ziel des spieles ist es"
  23. 11230 print " mehr steine auf dem brett zu haben"
  24. 11240 print " als der computer. dazu werden"
  25. 11250 print " abwechselnd eigene steine so auf das"
  26. 11260 print " brett gelegt, dass mit diesem stein"
  27. 11270 print " gegnerische steine an beiden seiten"
  28. 11280 print " eingeschlossen werden. diese steine"
  29. 11290 print " werden dann zu steinen eigener"
  30. 11300 print " farbe gemacht."
  31. 11301 print "             space[146] druecken"
  32. 11302 get a$:if a$<>" " then 11302
  33. 11310 print "[147]         s p i e l r e g e l            [146]"
  34. 11320 print " sie sind an der reihe, wenn hinter"
  35. 11330 print " 'welches feld moechten sie besetzen'"
  36. 11340 print " diese flaeche [166][166] ist. dann geben sie"
  37. 11350 print " die ziffer am linken rand und dann"
  38. 11360 print " die ziffer am oberen rand des ge-"
  39. 11370 print " wuenschten feldes ein. diese zahlen"
  40. 11380 print " erscheinen dann an stelle von [166][166]."
  41. 11390 print " wenn sie keinen gueltigen zug machen"
  42. 11400 print " koennen geben sie eine '0' ein."
  43. 11510 print " moechten sie beginnen (j/n) ?"
  44. 11520 get m$:if m$<>"j" and m$<>"n" then 11520
  45. 12000 rem belegen der felder *************************************************
  46. 12010 poke 53,90
  47. 12020 poke 25816,0
  48. 12030 dim zc(40),ss(40),sc(40)
  49. 12040 for n=1 to 8:read m:next
  50. 12050 for n=25800 to 25807:read m:poke n,m:next
  51. 12060 for n=25600 to 25699:read m:poke n,m:poke n+256,m:next
  52. 12070 for n=25700 to 25799:read m:poke n,m+100:poke n+256,m:next
  53. 12080 for n=26112 to 26211:read m:poke n,m:next
  54. 12085 if fl=1 then 12100
  55. 12090 for n=24090 to 24457:read m:poke n,m:next
  56. 12100 restore
  57. 12200 h$=""
  58. 12210 c$=left$(h$,20)+"welches feld moechten sie besetzen? [166][166] [157][157][157]"
  59. 12220 d$=h$+"dieses feld gibt es nicht"
  60. 12230 e$=h$+"der zug ist illegal      "
  61. 12240 f$=h$+"ich besetze feld      [157][157][157]"
  62. 12250 g$=h$+"ich kann nicht setzen    "
  63. 12260 as=2:ac=2:fl=0
  64. 13000 rem zeichnen des bildschirmes ******************************************
  65. 13010 print "[147]   1 2 3 4 5 6 7 8"
  66. 13020 print "  [176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174]   [209]:computer"
  67. 13030 print "1 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
  68. 13040 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]    [146]:spieler"
  69. 13050 print "2 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
  70. 13060 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
  71. 13070 print "3 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]   anzahl der felder"
  72. 13080 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]   [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  73. 13090 print "4 [221][160][221][160][221][160][221][209][221] [146][221] [221][160][221][160][221]   computer:  2"
  74. 13100 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
  75. 13110 print "5 [221][160][221][160][221][160][221][209][221] [146][221] [221][160][221][160][221]   spieler :  2"
  76. 13120 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
  77. 13130 print "6 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
  78. 13140 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
  79. 13150 print "7 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
  80. 13160 print "  [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
  81. 13170 print "8 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
  82. 13180 print "  [173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
  83. 13190 if fl=1 then return
  84. 13200 print "";tab(22);"bedenkzeit"
  85. 13210 print tab(22);"[163][163][163][163][163][163][163][163][163][163]"
  86. 13220 print tab(22);"computer:"
  87. 13230 print "";tab(22);"spieler :"
  88. 14000 rem frage wer beginnt **************************************************
  89. 14010 if m$="n" then 40000
  90. 15000 rem eingabe des zuges **************************************************
  91. 15010 zs=ti
  92. 15020 poke 158,0:print c$;
  93. 15030 gosub 53000:get a$:if a$="" then 15030
  94. 15040 if a$="0" then ss(ss)=25600:ss=ss+1:goto 18000
  95. 15050 if val(a$)=0 or val(a$)=9 then print d$:goto 15020
  96. 15060 print left$(h$,20);tab(36);a$;
  97. 15070 gosub 53000:get b$:if b$="" then 15070
  98. 15080 if val(b$)=0 or val(b$)=9 then print d$:goto 15020
  99. 15090 print left$(h$,20);tab(37);b$
  100. 16000 rem zug auf legalitaet pruefen und ausfuehren **************************
  101. 16010 a=val(a$+b$)+25600
  102. 16020 if peek(a)<>0 then print e$:goto 15020
  103. 16030 d=0
  104. 16040 for n=1 to 8
  105. 16050 read j:k=a+j
  106. 16060 if peek(k)<>2 then 16150
  107. 16070 k=k+j
  108. 16080 if peek(k)=2 then 16070
  109. 16090 if peek(k)<>1 then 16150
  110. 16100 k=a+j
  111. 16110 h=(k-25600)/10
  112. 16120 poke(1025.5+int(h)*80+(h-int(h))*20),160
  113. 16130 poke k,1:k=k+j:d=d+1
  114. 16140 if peek(k)=2 then 16110
  115. 16150 next n:restore
  116. 16160 if d=0 then print e$:goto 15020
  117. 16170 poke a,1
  118. 16180 h=(a-25600)/10
  119. 16190 poke(1025.5+int(h)*80+(h-int(h))*20),160
  120. 16200 if fl=1 then return
  121. 16210 ss(ss)=a:ss=ss+1
  122. 17000 rem berechnung der felderzahl ******************************************
  123. 17010 as=as+d+1:ac=ac-d
  124. 17020 print left$(h$,9);tab(32);ac;"[157] "
  125. 17030 print "";tab(32);as;"[157] "
  126. 17040 if fl=1 then return
  127. 18000 rem zeitrechnung spieler ***********************************************
  128. 18010 gosub 53000
  129. 18020 ts=ts+(ti-zs)/60
  130. 18030 if a$="0" then 40000
  131. 19000 rem zugfeld veraendern *************************************************
  132. 19010 a=a+512
  133. 19020 for n=1 to 8
  134. 19030 read j
  135. 19040 poke (a+j),(peek(a+j)+1)
  136. 19050 next n:restore
  137. 19060 poke a,0
  138. 19999 if as+ac=64 then 50000
  139. 20000 rem wertung der felder *************************************************
  140. 20010 n=25611
  141. 20020 if peek(n)<>2 then 20210
  142. 20030 n=n+10
  143. 20040 if peek(n)=0 then poke n+100,170:goto 20110
  144. 20050 if peek(n)=2 then 20030
  145. 20060 n=n+10
  146. 20070 if peek(n)=1 then 20060
  147. 20080 poke n+100,172
  148. 20110 n=25611
  149. 20130 n=n+1
  150. 20140 if peek(n)=0 then poke n+100,170:goto 20190
  151. 20150 if peek(n)=2 then 20130
  152. 20160 n=n+1
  153. 20170 if peek(n)=1 then 20160
  154. 20180 poke n+100,172
  155. 20190 n=25711:poke n+11,160:poke n+21,150:poke n+22,150:poke n+12,150
  156. 20210 n=25618
  157. 20220 if peek(n)<>2 then 20410
  158. 20230 n=n+10
  159. 20240 if peek(n)=0 then poke n+100,170:goto 20310
  160. 20250 if peek(n)=2 then 20230
  161. 20260 n=n+10
  162. 20270 if peek(n)=1 then 20260
  163. 20280 poke n+100,172
  164. 20310 n=25618
  165. 20330 n=n-1
  166. 20340 if peek(n)=0 then poke n+100,170:goto 20390
  167. 20350 if peek(n)=2 then 20330
  168. 20360 n=n-1
  169. 20370 if peek(n)=1 then 20360
  170. 20380 poke n+100,172
  171. 20390 n=25718:poke n+9,160:poke n+19,150:poke n+18,150:poke n+8,150
  172. 20410 n=25681
  173. 20420 if peek(n)<>2 then 20610
  174. 20430 n=n-10
  175. 20440 if peek(n)=0 then poke n+100,170:goto 20510
  176. 20450 if peek(n)=2 then 20430
  177. 20460 n=n-10
  178. 20470 if peek(n)=1 then 20460
  179. 20480 poke n+100,172
  180. 20510 n=25681
  181. 20530 n=n+1
  182. 20540 if peek(n)=0 then poke n+100,170:goto 20590
  183. 20550 if peek(n)=2 then 20530
  184. 20560 n=n+1
  185. 20570 if peek(n)=1 then 20560
  186. 20580 poke n+100,172
  187. 20590 n=25781:poke n-9,160:poke n-19,150:poke n-18,150:poke n-8,150
  188. 20610 n=25688
  189. 20620 if peek(n)<>2 then 21000
  190. 20630 n=n-10
  191. 20640 if peek(n)=0 then poke n+100,170:goto 20710
  192. 20650 if peek(n)=2 then 20630
  193. 20660 n=n-10
  194. 20670 if peek(n)=1 then 20660
  195. 20680 poke n+100,172
  196. 20710 n=25688
  197. 20720 if peek(n)<>2 then 20100
  198. 20730 n=n-1
  199. 20740 if peek(n)=0 then poke n+100,170:goto 20790
  200. 20750 if peek(n)=2 then 20730
  201. 20760 n=n-1
  202. 20770 if peek(n)=1 then 20760
  203. 20780 poke n+100,172
  204. 20790 n=25788:poke n-11,160:poke n-21,150:poke n-22,150:poke n-12,150
  205. 21000 rem ende eckenbewertung
  206. 40000 rem computerzuege ******************************************************
  207. 40010 zc=ti
  208. 40020 poke 16,10*rnd(1)
  209. 40030 sys 24090
  210. 40040 if peek(25812)=0 then print g$:sc(sc)=25600:sc=sc+1:goto 48000
  211. 45000 rem ausgabe und ausfuehrung des zuges **********************************
  212. 45010 print f$;peek(25813);"[157]       "
  213. 45015 g=peek(25813)+25600
  214. 45020 d=0
  215. 45030 for n=1 to 8
  216. 45040 read e:f=g+e
  217. 45050 if peek(f)<>1 then next n:goto 45150
  218. 45060 f=f+e
  219. 45070 if peek(f)=1 then 45060
  220. 45080 if peek(f)<>2 then next n:goto 45150
  221. 45090 f=g+e
  222. 45100 h=(f-25600)/10
  223. 45110 poke(1025.5+int(h)*80+(h-int(h))*20),81
  224. 45120 poke f,2:f=f+e:d=d+1
  225. 45130 if peek(f)=1 then 45100
  226. 45140 next n
  227. 45150 restore
  228. 45160 poke g,2:h=(g-25600)/10
  229. 45170 poke(1025.5+int(h)*80+(h-int(h))*20),81
  230. 45180 if fl=1 then return
  231. 45190 sc(sc)=g:sc=sc+1
  232. 46000 rem zugfeld veraendern *************************************************
  233. 46005 g=g+512
  234. 46010 poke g,0
  235. 46020 for n=1 to 8
  236. 46030 read m
  237. 46040 poke(g+m),(peek(g+m)+1)
  238. 46050 next n:restore
  239. 47000 rem berechnung der felderzahl ******************************************
  240. 47010 as=as-d:ac=ac+d+1
  241. 47020 print left$(h$,9);tab(32);ac;"[157] "
  242. 47030 print "";tab(32);as;"[157] "
  243. 47040 if fl=1 then return
  244. 48000 rem zeitrechnung *******************************************************
  245. 48010 zc(za)=(ti-zc)/60:tc=tc+zc(za):za=za+1
  246. 48020 print left$(h$,15);tab(32);int(tc*10)/10
  247. 49000 if as+ac<64 then 15000
  248. 50000 rem spielende **********************************************************
  249. 50010 print left$(h$,20);"das spiel ist beendet                  "
  250. 50020 if ac>32 then print "ich habe gewonnen                     "
  251. 50030 if ac=32 then print "das spiel endete remis                "
  252. 50040 if ac<32 then print "sie haben glueck gehabt               "
  253. 50042 print "                                      "
  254. 50045 print "space[146] druecken"
  255. 50050 get z$:if z$="" then 50050
  256. 51000 rem zeitdiagramm *******************************************************
  257. 51002 za=0
  258. 51005 print "[147]"
  259. 51007 for n=2 to 0 step -.2:print int(n*10+.5)/10;"[192]":next
  260. 51008 print "      1   5    10   14   21   25   30"
  261. 51010 if zc(za)=0 then 51110
  262. 51020 zc=int(zc(za)*10+.5)
  263. 51040 ze=1950+za
  264. 51045 if zc>20 then zc=20
  265. 51050 for n=1 to zc
  266. 51060 poke(ze-40*n),160:poke(ze-40*n+54272),7
  267. 51070 next n
  268. 51090 za=za+1
  269. 51100 goto 51010
  270. 51110 get z$:if z$<>" " then 51110
  271. 52000 rem spiel wiederholen **************************************************
  272. 52010 fl=1
  273. 52015 for n=1to16:read m:next:for n=25600 to 25699:read m:poke n,m:next:restore
  274. 52020 gosub 13000
  275. 52025 print left$(h$,20);"s p a c e[146] druecken"
  276. 52030 ss=0:sc=0:ac=2:as=2
  277. 52035 if m$="n" then 52060
  278. 52040 a=ss(ss):ss=ss+1
  279. 52050 if a<>25600 then gosub 16030:gosub 17000:z=z+1
  280. 52051 if z=60 then 61000
  281. 52052 get z$:if z$<>" " then 52052
  282. 52060 g=sc(sc):sc=sc+1
  283. 52070 if g<>25600 then gosub 45020:gosub 47000:z=z+1
  284. 52080 if z=60 then 52110
  285. 52090 get z$:if z$=" " then 52040
  286. 52100 goto 52090
  287. 52110 print left$(h$,20);" moechten sie noch einmal spielen ?"
  288. 52120 get a$:if a$="j" then clr:fl=1:goto 11510
  289. 52130 if a$<>"n" then 52120
  290. 52140 end
  291. 53000 rem zeitrechnung spieler ***********************************************
  292. 53010 print "";tab(32);int((ts+(ti-zs)/60)*10)/10
  293. 53020 return
  294. 59998 data 11,10,9,1,-1,-9,-10,-11
  295. 59999 data 1,9,10,11,255,247,246,245
  296. 60000 data 9,9,9,9,9,9,9,9,9,9
  297. 60010 data 9,0,0,0,0,0,0,0,0,9
  298. 60020 data 9,0,0,0,0,0,0,0,0,9
  299. 60030 data 9,0,0,0,0,0,0,0,0,9
  300. 60040 data 9,0,0,0,2,1,0,0,0,9
  301. 60050 data 9,0,0,0,2,1,0,0,0,9
  302. 60060 data 9,0,0,0,0,0,0,0,0,9
  303. 60070 data 9,0,0,0,0,0,0,0,0,9
  304. 60080 data 9,0,0,0,0,0,0,0,0,9
  305. 60090 data 9,9,9,9,9,9,9,9,9,9
  306. 60100 data 00,00,00,00,00,00,00,00,00,00
  307. 60110 data 00,80,40,60,55,55,60,40,80,00
  308. 60120 data 00,40,00,35,35,35,35,00,40,00
  309. 60130 data 00,60,35,41,40,40,41,35,60,00
  310. 60140 data 00,60,35,40,00,00,40,35,60,00
  311. 60150 data 00,60,35,40,00,00,40,35,60,00
  312. 60160 data 00,60,35,41,40,40,41,35,60,00
  313. 60170 data 00,40,00,35,35,35,35,00,40,00
  314. 60180 data 00,80,40,60,55,55,60,40,80,00
  315. 60190 data 00,00,00,00,00,00,00,00,00,00
  316. 60200 data 000,000,000,000,000,000,000,000,000,000
  317. 60210 data 000,127,127,127,127,127,127,127,127,000
  318. 60220 data 000,127,127,127,127,127,127,127,127,000
  319. 60230 data 000,127,127,128,128,128,128,127,127,000
  320. 60240 data 000,127,127,128,000,000,128,127,127,000
  321. 60250 data 000,127,127,128,000,000,128,127,127,000
  322. 60260 data 000,127,127,128,128,128,128,127,127,000
  323. 60270 data 000,127,127,127,127,127,127,127,127,000
  324. 60280 data 000,127,127,127,127,127,127,127,127,000
  325. 60290 data 000,000,000,000,000,000,000,000,000,000
  326. 61000 end
  327. 61700 data 169,0,141,212,100,141,213,100,169,11,141,214,100
  328. 61800 data 174,214,100,189,0,102,16,67
  329. 61900 data 169,0,141,208,100,160,200,173,214,100,24,121,0,100,170,189,0,100
  330. 61910 data 201,1,208,35,238,216,100,138,24,121,0,100,170
  331. 61920 data 189,0,100,201,1,240,240,201,2,208,10,173,208,100,24
  332. 61930 data 109,216,100,141,208,100,169,0,141,216,100,200,192,208,208,201
  333. 61950 data 173,208,100,208,3,76,124,95,174,214,100,189,100,100,24
  334. 61960 data 109,208,100,141,208,100,56,205,212,100,144,234
  335. 62000 data 162,11,189,0,100,157,0,101,232,224,89,208,245
  336. 62100 data 174,214,100,169,2,157,0,101,160,200,185,0,100,24
  337. 62110 data 109,214,100,170,189,0,101,201,1,208,40,138
  338. 62120 data 24,121,0,100,170,189,0,101,201,1,240,243
  339. 62130 data 201,2,208,23,173,214,100,24,121,0,100,170
  340. 62140 data 189,0,101,201,1,208,8,169,2,157,0,101,138
  341. 62150 data 208,236,200,192,208,208,196
  342. 62160 data 169,0,141,211,100,169,11,141,215,100
  343. 62180 data 173,215,100,170,189,0,101,208,99
  344. 62200 data 169,0,141,209,100,160,200,173,215,100,24,121,0,100,170,189,0,101
  345. 62210 data 201,2,208,35,238,216,100,138,24,121,0,100,170
  346. 62220 data 189,0,101,201,2,240,240,201,1,208,10,173,209,100,24
  347. 62230 data 109,216,100,141,209,100,169,0,141,216,100,200,192,208,208,201
  348. 62250 data 173,209,100,240,32
  349. 62300 data 174,215,100,189,100,101,24,109,209,100,56,205,211,100
  350. 62310 data 144,3,141,211,100
  351. 62350 data 56,173,208,100,237,211,100,56,237,212,100,144,43
  352. 62360 data 238,215,100,173,215,100,201,89,208,138
  353. 62400 data 56,173,208,100,237,211,100,56,205,212,100
  354. 62401 data 208,9,165,16,56,201,5,144,7,176,11,144,9
  355. 62410 data 141,212,100,173,214,100,141,213,100
  356. 62500 data 238,214,100,173,214,100,201,89,240,3,76,39,94,96
  357.